package com.itheima.Test.HashSet;

import java.util.HashSet;

public class SetDemo02 {
    public static void main(String[] args) {
        HashSet<Student> hs=new HashSet<>();
        Student stu1=new Student("zs",18);
        Student stu2=new Student("zs",18);
        Student stu3=new Student("ls",19);
        hs.add(stu1);
        hs.add(stu2);
        hs.add(stu3);
        for (Student student : hs) {
            System.out.println(student);
        }
        System.out.println(stu1.hashCode());
        System.out.println(stu2.hashCode());
        System.out.println(stu3.hashCode());
    }
}
